package 动态数组.队列.测试;

import 动态数组.队列.ArrayLoopQueue;

/**
 * 循环队列的测试
 */
public class TestArrayLoopQueue {
    public static void main(String[] args) {
        ArrayLoopQueue<Integer> queue = new ArrayLoopQueue<>();
        System.out.println(queue.isEmpty());
        for (int i = 1; i <= 6 ; i++) {
            queue.offer(i);
        }
        System.out.println(queue.isEmpty());
        System.out.println(queue);
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue);
        System.out.println(queue.size());
        System.out.println(queue.element());

        System.out.println("------------");
        for (Integer integer : queue) {
            System.out.println(integer);
        }
        System.out.println("---------------");
        ArrayLoopQueue<Integer> queue1 = new ArrayLoopQueue<>();
        for (int i = 1; i <= 6 ; i++) {
            queue1.offer(i);
        }
        ArrayLoopQueue<Integer> queue2 = new ArrayLoopQueue<>();
        for (int i = 3; i <= 6 ; i++) {
            queue2.offer(i);
        }
        System.out.println(queue.equals(queue1));
    }
}
